<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title></title>
<%@include file="/common/meta.jsp"%>
<%@include file="/common/ec.jsp"%>
</head>
<body>
<div class="x-panel-header">项目管理</div>
<div class="x-toolbar">
  <form action="index.do" method="post">
  <table>
    <tr>
      <td>
		<span style="color: green; font-weight: bold;">项目名称：</span>&nbsp;
		<s:textfield name="model.name" size="20" cssStyle="height:22px;"/>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" value="查询" class="button" style="height: 22px;">
      </td>
      <td align="right">&nbsp;&nbsp;
        <img src="${ctx}/images/icons/add.gif">
	  	<a href="edit.do">&nbsp;添加项目</a>
      </td>
    </tr>
  </table>
  </form>
  <%@ include file="/common/messages.jsp"%>
</div>
<ec:table items="items" var="item" retrieveRowsCallback="limit" sortRowsCallback="limit" 
	action="index.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="20,50" 
	editable="false"
	sortable="false" 
	rowsDisplayed="20" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="100%" 
	height="320px"
	minHeight="320"
	showHeader="true"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
		<ec:column width="35" property="_no." title="No." value="${GLOBALROWCOUNT}" style="text-align:center;" />
		<ec:column width="250" property="name" title="项目名称" ellipsis="true"/>
		<ec:column width="130" property="_type" title="项目分类">
		  &nbsp;${item.projectType.name}&nbsp;[${item.projectType.code}]
		</ec:column>
		<ec:column width="170" property="_date" title="项目周期" style="text-align:center;">
		  <s:date name="#attr.item.startTime" format="yyyy/MM/dd"/> 至 <s:date name="#attr.item.endTime" format="yyyy/MM/dd"/>
		</ec:column>
		<ec:column width="150" property="managerNames" title="项目负责人" ellipsis="true"/>
		<ec:column width="110" property="_opt" title="操作" style="text-align:center;">
		  <a href="${ctx}/budget/editNew.do?model.project.id=${item.id}" title="预算定制">
		    <img src="${ctx}/images/icons/articles.gif"></a>&nbsp;
		    
		  <a href="edit.do?model.id=${item.id}" title="编辑">
		    <img src="${ctx}/images/icons/modify.gif"></a>&nbsp;
		    
		  <a href="#" onclick="remove('${item.id}')" title="删除">
		    <img src="${ctx}/images/icons/delete.gif"></a>
		</ec:column>
	</ec:row>
</ec:table>

<script type="text/javascript">
  function remove(id){
	  if (confirm("确实要删除本项目吗?")){
		  window.location.href = "remove.do?model.id=" + id;
	  }
  }
</script>
</body>
</html>